Method for encoding an intra prediction mode

ABSTRACT

Provided is a method that de-multiplexes a bit stream to extract intra prediction mode information and residual signals, restores an intra prediction mode of a current prediction unit using the intra prediction information and intra prediction modes of prediction units adjacent to the current prediction unit, generates reference pixels using one or more available reference pixel if there exist unavailable reference pixels of the prediction unit, adaptively filters the reference pixels based on the restored intra prediction mode, generates a prediction block using the restored intra prediction mode and the reference pixels, decodes the residual signal to generating a residual block, and generates a reconstructed block using the prediction block and the residual block. Accordingly, additional bits resulted from increase of a number of intra prediction mode are effectively reduced. Also, an image compression ratio can be improved by generating a prediction block similar to an original block.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of U.S. application Ser.No. 13/624,844 filed on Sep. 21, 2012, which is a continuationapplication of International Application No. PCT/KR2011/005941 filed onAug. 12, 2011, which claims priority to Korean Application No.10-2010-0079529 filed on Aug. 17, 2010 and Korean Application No.10-2011-0064301 filed Jun. 30, 2011, which applications are incorporatedherein by reference.

TECHNICAL FIELD

The present invention relates to a method of decoding a moving picturein intra prediction mode, and more particularly, to a method ofrestoring intra prediction mode, generating a prediction block verysimilar to an original block, decoding a residual block, and generatinga reconstructed block using the prediction block and residual block.

BACKGROUND ART

In image compression methods such as Motion Picture Experts Group(MPEG)-1, MPEG-2, MPEG-4 and H.264/MPEG-4 Advanced Video Coding (AVC),one picture is divided into macroblocks to encode an image. Then, therespective macroblocks are encoded using inter prediction or intraprediction.

In intra prediction, a current block of a picture is encoded not using areference picture, but using values of reconstructed pixels spatiallyadjacent to the current block. An intra prediction mode with littledistortion is selected by comparing a prediction block generated usingthe adjacent pixel values with an original macroblock. Then, using theselected intra prediction mode and the adjacent pixel values, predictionvalues of the current block are calculated. Differences between theprediction values and pixels values of the original current block arecalculated and then encoded through transform coding, quantization andentropy coding. The intra prediction mode is also encoded.

In 4×4 conventional intra prediction, there are nine modes of a verticalmode, a horizontal mode, a DC mode, a diagonal down-left mode, adiagonal down-right mode, a vertical right mode, a vertical left mode, ahorizontal-up mode and a horizontal-down mode.

According to H.264 standard, one mode is selected among the nine modesto generate a prediction block of the current block. According to HEVCstandard under development, there are 17 or 34 intra prediction modes.

However, when some or all values of pixels adjacent to current block donot exist or are not already encoded, it is impossible to apply some orall of the intra prediction modes to the current block. Also, when thereis a large difference between adjacent reference pixels, distortionbetween a prediction block and an original block becomes large.Therefore, the coding efficiency is degraded.

Also, as the number of intra prediction modes increases, a new method ofencoding the intra prediction mode of the current block to minimize theamount of coding bits, and a more effective method of decoding the intraprediction mode and generating a reconstructed block are required.

SUMMARY OF THE DISCLOSURE

The present invention is directed to a method of restoring intraprediction mode, generating a prediction block very similar to anoriginal block, decoding a residual block, and generating areconstructed block using the prediction block and residual block.

One aspect of the present invention provides a method of decoding amoving picture in intra prediction mode, comprising: de-multiplexing abit stream to extract intra prediction mode information and residualsignals, restoring an intra prediction mode of a current prediction unitusing the intra prediction information and intra prediction modes ofprediction units adjacent to the current prediction unit, generatingreference pixels using one or more available reference pixel if thereexist unavailable reference pixels of the prediction unit, adaptivelyfiltering the reference pixels based on the restored intra predictionmode, generating a prediction block using the restored intra predictionmode and the reference pixels, decoding the residual signal togenerating a residual block, and generating a reconstructed block usingthe prediction block and the residual block.

A method according to the present invention restores intra predictionmode, and adaptively filters reference pixels in order to generate aprediction block minimizing the difference between a prediction blockand an original block. The residual signal is adaptively decoded theintra prediction mode. Therefore, by generating the prediction blockvery similar to an original block, the amount of bits required to encodethe residual block is minimized Also, by encoding the intra predictionmode of the current block using a plurality of candidates, codingefficiency of intra prediction mode is improved.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of a moving picture coding apparatus accordingto the present invention.

FIG. 2 is a block diagram of an intra prediction unit of a movingpicture coding apparatus according to the present invention.

FIG. 3 is a conceptual diagram showing positions of reference pixelsused for intra prediction according to the present invention.

FIG. 4 is a conceptual diagram illustrating directional intra predictionmodes according to the present invention.

FIG. 5 is a block diagram of a moving picture decoding apparatusaccording to the present invention.

FIG. 6 is a block diagram of an intra prediction unit of a movingpicture decoding apparatus according to the present invention.

FIG. 7 is a flow chart illustrating a decoding procedure in intraprediction mode according to the present invention.

FIG. 8 is a flow chart illustrating a procedure for restoring intraprediction mode according to the present invention.

FIG. 9 is a flow chart illustrating another procedure for restoringintra prediction mode according to the present invention.

DETAILED DESCRIPTION OF THE DISCLOSURE

Hereinafter, various embodiments of the present invention will bedescribed in detail with reference to the accompanying drawings.However, the present invention is not limited to the exemplaryembodiments disclosed below, but can be implemented in various types.Therefore, many other modifications and variations of the presentinvention are possible, and it is to be understood that within the scopeof the disclosed concept, the present invention may be practicedotherwise than as has been specifically described.

FIG. 1 is a block diagram of a moving picture coding apparatus accordingto the present invention.

Referring to FIG. 1, a moving picture coding apparatus 100 according tothe present invention includes a picture division unit 110, a transformunit 120, a quantization unit 130, a scanning unit 131, an entropycoding unit 140, an intra prediction unit 150, an inter prediction unit160, an inverse quantization unit 135, an inverse transform unit 125, apost-processing unit 170, a picture storing unit 180, a subtracter 190and an adder 195.

The picture division unit 110 analyzes an input video signal to divideeach LCU of a picture into one or more coding units each of which has apredetermined size, determine prediction mode of each coding unit, anddetermines size of prediction unit per each coding unit. The picturedivision unit 110 sends the prediction unit to be encoded to the intraprediction unit 150 or the inter prediction unit 160 according to theprediction mode. Also, the picture division unit 110 sends theprediction units to be encoded to the subtracter 190.

The transform unit 120 transforms residual signals between an originalblock of a prediction unit and a prediction block generated by the intraprediction unit 150 or the inter prediction unit 160. The residual blockmay have a size of coding unit. The residual block may be divided intooptimal transform units and transformed. A transform matrix type may beadaptively determined according to a prediction mode and an intraprediction mode. The transform unit of the residual signals may betransformed by horizontal and vertical one-dimensional (1D) transformmatrices. In inter prediction, one predetermined transform matrix typeis applied. In intra prediction, there is a high possibility that theresidual signals will have vertical directivity when the intraprediction mode of the current prediction unit is horizontal. Thus, adiscrete cosine transform (DCT)-based integer matrix is applied to thevertical direction, and a discrete sine transform (DST) or KarhunenLoeve transform (KLT)-based integer matrix is applied to the horizontaldirection. When the intra prediction mode is vertical, a DST orKLT-based integer matrix is applied to the vertical direction, and aDCT-based integer matrix is applied to the horizontal direction. Also,in intra prediction, the transform matrix may be adaptively determinedaccording to a size of the transform units.

The quantization unit 130 determines a quantization step size forquantizing transform coefficients of the residual block according tocoding units. The quantization step size is determined per coding unithaving a size equal to or larger than a predetermined size. Thepredetermined size may be 8×8 or 16×16. Using the determinedquantization step size and a quantization matrix determined according toa prediction mode, the transform coefficients are quantized. Thequantization unit 130 uses quantization step sizes of one or more codingunits adjacent to the current coding unit to generate a quantizationstep size predictor of the current coding unit. The quantization unit130 sequentially retrieves coding units in the following scan order; 1)a left coding unit of the current coding unit, 2) an above coding unitof the current coding unit, and 3) an above left coding unit of thecurrent coding unit. And the quantization unit generates thequantization step size predictor of the current coding unit using one ortwo valid quantization step sizes. For example, the first validquantization step size encountered in the scan order may be determinedas the quantization step size predictor. An average of the first twovalid quantization step size retrieved in the scan order may bedetermined as the quantization step size predictor when two or morequantization step sizes are valid, and one valid quantization step sizeis determined as the quantization step size predictor when only onequantization step size is valid. When the quantization step sizepredictor is determined, a difference between the quantization step sizeand the quantization step size predictor is transmitted to the entropycoding unit 140.

There may be none of a left coding unit, an above coding unit and anabove left coding unit of the current coding unit. On the other hand,there may be a previous coding unit of the current coding unit in codingorder. Thus, coding units adjacent to the current coding unit and theprevious coding unit may be candidates In this case, the above scanningorder may be changed to the following scan order; 1) the left codingunit of the current coding unit, 2) the above coding unit of the currentcoding unit, 3) the above left coding unit of the current coding unitand 4) the previous coding unit of the current coding unit. The scanorder may vary, or the above left coding unit may be omitted in scanorder.

The quantized transform block is provided to the inverse quantizationunit 135 and the scanning unit 131.

The scanning unit 131 scans the quantized transform coefficients of thequantized transform block, thereby converting the quantized transformcoefficients into 1D quantized transform coefficients. A scan pattern isdetermined according to the intra prediction mode because thedistribution of the quantized transform coefficients depends on theintra prediction mode. The scan pattern may also be determined accordingto the size of the transform unit. The scan pattern may be determineddepending on the directional intra prediction mode. The quantizedtransform coefficients are scanned in a reverse direction.

When the quantized transform coefficients are into a plurality ofsubsets, same scan pattern is applied to each subset. The plurality ofsubsets consist of one main subset and one or more residual subsets. Themain subset is located at an upper left side and includes a DCcoefficient. The one or more residual subsets cover region other thanthe main subset.

Zigzag scan may be applied to scan the subsets. The subsets may bescanned beginning with the main subset to the residual subsets in aforward direction, or can be scanned in a reverse direction. A scanpattern for scanning the subsets may be set the same as a scan patternfor scanning the quantized transform coefficients. In this case, thescan pattern for scanning the subsets is determined according to theintra prediction mode. An encoder transmits information capable ofindicating a position of the last non-zero quantized coefficient of thetransform unit to a decoder. The encoder also transmits informationcapable of indicating a position of the last non-zero quantizedcoefficient of each subset to the decoder.

The inverse quantization unit 135 inversely quantizes the quantizedtransform coefficients. The inverse transform unit 125 restores residualsignals of the spatial domain from the inversely quantized transformcoefficients. The adder 195 generates a reconstructed block by addingthe residual block reconstructed by the inverse transform unit 125 andthe prediction block from the intra prediction unit 150 or the interprediction unit 160.

The post-processing unit 170 performs a deblocking filtering process forremoving blocking artifact generated in a reconstructed picture, anadaptive offset application process for complementing a differencebetween the reconstructed picture and the original image per pixel, andan adaptive loop filter process for complementing a difference betweenthe reconstructed picture and the original image in a coding unit.

The deblocking filtering process may be applied to a boundary betweenprediction units having a predetermined size or more and betweentransform units. The predetermined size may be 8×8. The deblockingfiltering process includes a step of determining a boundary to befiltered, a step of determining boundary filtering strength to beapplied to the boundary, a step of determining whether or not to apply adeblocking filter, and a step of selecting a filter to be applied to theboundary when it is determined to apply the deblocking filter.

Whether or not to apply the deblocking filter is determined according toi) whether or not the boundary filtering strength is greater than 0 andii) whether or not a value indicating the difference between boundarypixels of P block and Q block is smaller than a first reference valuedetermined according to a quantization parameter.

Two or more filters may exist. When an absolute value of a differencebetween two pixels adjacent to the block boundary is equal to or largerthan a second reference value, a weak filter is selected. The secondreference value is determined by the quantization parameter and theboundary filtering strength.

The adaptive offset application process is intended to reduce adifference (distortion) between a pixel subjected to the deblockingfilter and the original pixel. A picture or slice may be divided into aplurality of offset regions, and an offset mode may be determined perthe offset region. There are four edge offset modes, two band offsetmodes and an offset non-application mode. According to each offset mode,pixels in each offset region are classified into a predetermined numberof classes, and offset corresponding to the classified class is added tothe pixel. In the case of an edge offset mode, a class of a currentpixel is determined by comparing the current pixel value with pixelvalues of two or more pixels adjacent to the current pixel.

The adaptive loop filter process may be performed on the basis of avalue obtained by comparing an original image and a reconstructed imageto which the deblocking filtering process or the adaptive offsetapplication process is applied. An adaptive loop filter (ALF) isdetected through one Laplacian activity value on the basis of a 4×4block. The determined ALF can be applied to all pixels included in a 4×4block or an 8×8 block. Whether or not to apply an ALF may be determinedaccording to coding units. A size and coefficients of a loop filter mayvary according to each coding unit. Information indicating whether ALFis applied to each coding unit, filter coefficient information andfilter shape information may be included in slice header and transmittedto the decoder. In the case of a chrominance signal, whether or not toapply the ALF may be determined in picture units. Unlike luminance, theloop filter may have a rectangular shape.

The adaptive loop filter process is performed on the basis of slice.Therefore, the information indicating whether the adaptive loop filterprocess is applied to a current slice or not is included in a sliceheader or a picture header. If the adaptive loop filter process isapplied to the current slice, the slice header or the picture includesinformation indicating a horizontal filter length and/or a verticalfilter length of luminance components.

The slice header or the picture header may include informationindicating the number of filters. If the number of filters is 2 or more,the coefficients of the filter may be encoded using prediction method.Accordingly, the slice header or the picture header may includeinformation indicating whether the coefficients of the filter is encodedusing prediction method or not, and the coefficients of the filter whenthe prediction method is used.

Chrominance components may also be filtered adaptively. The slice headeror the picture header may include information whether each chrominancecomponent is filtered or not. To reduce the amount of bits, theinformation indicating whether the Cr component is filtered andinformation indicating whether the Cb component is filtered may be codedjointly. A lowest index is assigned to the case that the none of Cr andCb components are not filtered because the probability that the none ofCr and Cb components are not filtered is high. A highest index isassigned to the case that the both of Cr and Cb components are filtered.

The picture storing unit 180 receives post-processed image from thepost-processing unit 170, and stores the image in picture units. Apicture may be a frame or a field. The picture storing unit 180 has abuffer (not shown) capable of storing a plurality of pictures.

The inter prediction unit 160 performs motion estimation using one ormore reference pictures stored in the picture storing unit 180, anddetermines one or more reference picture indexes indicating thereference pictures and one or more motion vectors. According to thereference picture index and motion vector, the inter prediction unit 160extracts a prediction block corresponding to a prediction unit to beencoded from a reference picture selected among a plurality of referencepictures stored in the picture storing unit 180 and outputs theextracted prediction block.

The intra prediction unit 150 performs intra prediction usingreconstructed reference pixels in a picture including a currentprediction unit. The intra prediction unit 150 receives the currentprediction unit to be predictively encoded, selects one of apredetermined number of intra prediction modes, and performs intraprediction. The predetermined number of intra prediction modes dependson a size of the current prediction unit. The intra prediction unit 150adaptively filters reference pixels to generate the intra predictionblock. When some of reference pixels are not available, it is possibleto generate the reference pixels at the invalid positions using validreference pixels.

The entropy coding unit 140 entropy-codes the quantized transformcoefficients from the quantization unit 130, intra predictioninformation received from the intra prediction unit 150, motioninformation received from the inter prediction unit 160, and so on.

FIG. 2 is a block diagram of the intra prediction unit 150 of a movingpicture coding unit 100 according to the present invention.

Referring to FIG. 2, the intra prediction unit 150 includes a referencepixel generating unit 151, a reference pixel filtering unit 152, aprediction block generating unit 153, a prediction mode determining unit154 and a prediction mode coding unit 155.

The reference pixel generating unit 151 determines that it is necessaryto generate reference pixels for intra prediction, and generatesreference pixels if it is necessary to generate the reference pixels.

FIG. 3 is a conceptual diagram showing positions of reference pixelsused for intra prediction according to the present invention. As shownin FIG. 3, the reference pixels of the current prediction unit used forintra prediction consist of above reference pixels, left referencepixels and a corner reference pixel. The above reference pixels coverareas C and D, and the left reference pixels cover areas A and B. Thecorner reference pixel is located at (x=−1, y=−1).

The reference pixel generating unit 151 determines whether the referencepixels are available or not. If one or more reference pixels are notavailable, the reference pixel generating unit 151 generates thereference pixels using available reference pixel.

When the current prediction unit is located at the upper boundary of apicture or a slice, the above reference pixels covering areas C and D donot exist. When the current prediction unit is located at the leftboundary of a picture or a slice, the left reference pixels coveringareas A and B do not exist. In those cases, reference pixels aregenerated by copying the value of an available pixel closest to theunavailable pixel. For example, when the current prediction unit islocated at the upper boundary of a picture or a slice, the abovereference pixels can be generated by copying an uppermost left referencepixel. When the current prediction unit is located at the left boundaryof a picture or a slice, the left reference pixels can be generated bycopying a leftmost above reference pixel.

When some of the left reference pixels or the above reference pixels arenot available, the reference pixels are generated as follows.

When the reference pixels covering area C is be available, the referencepixels covering area D may not be available. For example, when thecurrent prediction unit is located at the right boundary of a slice or alargest coding unit, the reference pixels covering area D are notavailable. The reference pixels covering area D are generated using oneor more available above reference pixels. The reference pixels coveringthe area D are generated by copying a rightmost pixel of available abovereference pixels or using two or more available above reference pixels.

When the reference pixels covering area A is be available, the referencepixels covering area B may not be available. For example, when thecurrent prediction unit is located at the below boundary of a slice or alargest coding unit, the reference pixels covering area B are notavailable. The reference pixels covering area B are generated using oneor more available left reference pixels. The reference pixels coveringthe area B are generated by copying a lowest pixel of available leftreference pixels or using two or more available left reference pixels.

As described above, if the unavailable reference pixel exists in onlyone direction from the available pixels, the reference pixel isgenerated by copying the value of an available pixel closest to theunavailable pixel. Alternatively, the reference pixels may be generatedusing two or more available pixels closest to the unavailable pixel.

If the unavailable reference pixel exists between the available pixels,the reference pixel is generated using two available reference pixelsclosest to the unavailable pixel in both sides. For example, when thecurrent block is located at the upper boundary of a slice and the aboveright block of the current block is available, the reference pixelscovering area C are not available, but the reference pixels coveringareas A and D are available. The reference pixel is generated byaveraging the two available reference pixels. But, linear interpolationmay be used to generate the reference when the area covered by theunavailable reference pixels is large.

The reference pixel filtering unit 152 filters adaptively referencepixels of the current prediction unit.

FIG. 4 is a conceptual diagram illustrating directional intra predictionmodes according to the present invention. Referring to the FIG. 4, theoperation of the reference pixel filtering unit 152 is described asfollows.

The reference pixel filtering unit 152 filters reference pixelsadaptively according to the intra prediction mode and position of thereference pixel.

In the vertical mode (mode 0), the horizontal mode (mode 1) and the DCmode (mode 2), the reference pixels are not filtered. But, indirectional intra prediction modes other than the mode 0 and 1, thereference pixels are adaptively filtered. The rightmost pixel of theabove reference pixels located at (x=2N−1, y=−1) and the lowest pixel ofthe left reference pixels located at (x=−1, y=2N−1) are not filtered.The other reference pixels are filtered using two adjacent referencepixels.

Low-pass filter is applied to smooth the differences between adjacentreference pixels. The low-pass filter may be a 3-tap filter [1, 2, 1] ora 5-tap filter [1, 2, 4, 2, 1].

The application of the low-pass filter is determined by a size of thecurrent prediction block and intra prediction mode.

A filter is adaptively applied to the reference pixels in thedirectional intra prediction modes 3, 6 and 9 having a direction of 45°with reference to the horizontal or vertical direction according to thesize of the prediction block. If the size is smaller than apredetermined size, a first filter is applied. If the size is equal toor larger than the predetermined size, a second filter stronger than thefirst filter may be applied. The predetermined size may be 16×16.

In directional intra prediction modes existing between the intraprediction mode 3, 6 or 9 and the horizontal or vertical intraprediction mode, the filter can be adaptively applied to referencepixels according to the size of the prediction block. The filter may beapplied in a predetermined number of intra prediction modes closest tothe mode 3, 6 or 9. The predetermined number may be increase as the sizeof the prediction block increases. For example, the filter is applied ina first number of intra prediction modes closest to mode 3, 6 or 9 for8×8 block, in a second number of intra prediction modes closest to mode3, 6 or 9 for 16×16 block, and in in a third number of intra predictionmodes closet to mode 3, 6 or 9 for 32×32 block. The first number isequal to or smaller than the second number, and the second number isequal to or smaller than the third number.

The prediction block generating unit 153 generates a prediction blockcorresponding to the intra prediction mode.

In the DC mode, a large difference between a reference pixel and aprediction pixel adjacent to the reference pixel may arise if theprediction pixel adjacent to the reference pixel is generated byaveraging a plurality of reference pixels. Therefore, the predictionpixels adjacent to above reference pixel or left reference pixel aregenerated by filtering the averaged value using the adjacent referencepixel. For example, a prediction pixel located at the upper left corneris generated by filtering the averaged value using two adjacentreference pixels. The other prediction pixels adjacent to a referencepixel are generated by filtering the averaged value using a referencepixel adjacent to the prediction pixel.

In the planar mode, the prediction pixels are generated using a cornerreference pixel, left reference pixels and above reference pixels. Aprediction pixel located at (a, b) is generated using a corner referencepixel located at (x=−1, y=−1), an above reference pixel located at (x=a,y=−1) and a left reference pixel located at (x=−1, y=b). The predictionpixels are not filtered by reference pixel.

When prediction pixels are generated by copying a corresponding abovereference pixel in the vertical mode (mode 0), a correlation between aleft reference pixel and a prediction pixel adjacent to the leftreference pixel decreases as the position of the prediction pixel goesdown. When prediction pixels are generated by copying a correspondingleft reference pixel in the horizontal mode (mode 1), a correlationbetween an above reference pixel and a prediction pixel adjacent to theabove reference pixel decreases as the position of the prediction pixelgoes right. Therefore, in the vertical mode, the prediction pixeladjacent to a left reference pixel is generated by filtering thecorresponding above reference pixel using one or more reference pixelsnot used when the prediction block is generated by copying thecorresponding above reference pixel. In the horizontal mode, theprediction pixels adjacent to an above reference pixel is generated byfiltering the corresponding left reference pixel using one or morereference pixels not used when the prediction block is generated bycopying the corresponding left reference pixel.

In the directional intra prediction modes existing to between modes 0and 6, and mode 6, when prediction pixels are generated using only abovereference pixels, the difference between a left reference pixel and aprediction pixel adjacent to the left reference pixel increases as theposition of the prediction pixel goes down.

In the directional intra prediction modes existing to between modes 1and 9, and mode 9, when prediction pixels are generated using only leftreference pixels, the difference between an above reference pixel and aprediction pixel adjacent to the above reference pixel increases as theposition of the prediction pixel goes right.

Therefore, in the directional intra prediction mode, some predictionpixels of a prediction block may be generated using above and leftreference pixels as follows.

In the mode 6, the prediction block is generated using above referencepixels and left prediction pixels adjacent to a reference pixel arefiltered. The area covered by left prediction pixels to be filtered mayvary according to prediction size. That is, the line number or ratio ofleft prediction pixel to be filtered may vary according to theprediction size. The line number may increase or remain the same or theratio may decrease as the prediction size increases.

For example, all prediction pixels of the first left line are filteredfor 4×4. All prediction pixels of the first left line and someprediction pixels of the second line are filtered for 8×8. The someprediction pixels may be located at (x=1, y=4, . . . , 7). Allprediction pixels of the first left line, a first number of predictionpixels of the second line and a second number of prediction pixels ofthe third line are filtered for 16×16. The first number of predictionpixels may be located at (x=1, y=4, . . . , 7) and the second number ofprediction pixels may be located at (x=2, y=8, . . . , 15). Allprediction pixels of the first left line, a first number of predictionpixels of the second line, a second number of prediction pixels of thethird line and a third number of prediction pixels of the fourth lineare filtered for 16×16. The third number of prediction pixels may belocated at (x=3, y=16, . . . , 31).

In a first number of intra prediction modes closest to the mode 6,prediction pixels may be filtered using the same method as in the mode6. A number of prediction pixels to be filtered may decrease as adirection of the intra prediction mode goes far from the direction ofthe mode 6. In a second number of intra prediction modes existingbetween mode 0 and 6 and closest to the mode 0, prediction pixels may befiltered using the same method as in the mode 0.

In the mode 9, prediction pixels may be filtered using the same methodas in the mode 6. In the intra prediction mode existing between modes 1and 9, prediction pixels may be filtered using the same method as in theintra prediction mode existing between modes 0 and 6.

The intra prediction mode determining unit 154 determines the intraprediction mode of the current prediction unit using the referencepixels. The intra prediction mode determining unit 154 selects one intraprediction mode in which the amount of coding bits of a residual blockis minimized as the intra prediction mode of the current predictionunit.

The intra prediction mode coding unit 155 encodes the intra predictionmode of the current prediction unit determined by the intra predictionmode determining unit 154. The intra prediction mode coding unit 155 maybe integrated into the intra prediction unit 150 or into the entropycoding unit 140

The intra prediction mode coding unit 155 encodes the intra predictionmode of the current prediction unit using intra prediction modes of theprediction units adjacent to the current prediction unit. The intraprediction mode coding unit 155 divide all intra prediction modes into aplurality intra prediction mode group, encodes information indicatingthe intra prediction mode group including the intra prediction mode ofthe current prediction unit, and mode index corresponding to the intraprediction mode of the current coding unit in the intra prediction modegroup. The number of the intra prediction mode groups is 2 or 3.

When the number of the intra prediction mode groups is 2, the operationof the intra prediction mode coding unit 155 is as follows.

First, the intra prediction modes of the prediction units adjacent tothe current prediction unit are derived. The prediction units may be aleft prediction unit and an above prediction unit. When there exist aplurality of above prediction units of the current prediction unit, theplurality of above prediction units are scanned in a predetermineddirection (e.g., from right to left) to determine the intra predictionmode of a first valid prediction unit as an above intra prediction mode.Also, when there exist a plurality of left prediction units of thecurrent prediction unit, the plurality of left prediction units arescanned in a predetermined direction (e.g., from bottom to top) todetermine the intra prediction mode of a first valid prediction unit asa left intra prediction mode. Alternatively, among a plurality of validprediction units, the intra prediction mode of a valid prediction unithaving the lowest intra prediction mode number may be set as an aboveintra prediction mode.

Next, the derived intra prediction mode may be converted into one of thepermissible modes when the derived intra prediction mode number is equalto or greater than the number of intra prediction modes permissible forthe current prediction unit.

Next, a first intra prediction mode group is constructed using thederived or converted intra prediction mode. The derived or convertedintra prediction modes and one or more intra prediction mode candidatesdetermined in a predetermined order by the derived or converted intraprediction modes are used to construct the first intra prediction modegroup. When the derived or converted intra prediction mode isdirectional mode, the one or more intra prediction mode candidates maybe directional intra prediction mode closest to the derived or convertedintra prediction mode.

Next, it is determined whether the intra prediction mode of the currentprediction unit belongs to the first intra prediction mode group or not.

When the intra prediction mode of the current prediction unit belongs tothe first intra prediction mode group, information indicating the firstintra prediction mode group and an index corresponding to the intraprediction mode of the current prediction unit in the first intraprediction mode group are encoded.

But, when the intra prediction mode of the current prediction unit doesnot belong to the first intra prediction mode group, informationindicating a second intra prediction mode group and an indexcorresponding to the intra prediction mode of the current coding unit inthe second intra prediction mode group are encoded. The second intraprediction mode group includes all intra prediction modes other than theintra prediction modes belonging to the first intra prediction modegroup.

When none of the above intra prediction mode and the left intraprediction mode is available, one or more intra prediction modes areadded to the first intra prediction mode group. For example, DC mode orplanar mode may be added when one intra prediction mode is added. DCmode and planar or vertical mode may be added when two intra predictionmodes are added. DC mode, planar mode and one of the vertical mode andhorizontal mode may be added when three intra prediction modes areadded.

When one of the above intra prediction mode and the left intraprediction mode is available or when the above intra prediction mode andthe left intra prediction mode are same, one or two intra predictionmodes may be added to the first intra prediction mode group. Forexample, DC mode or planar mode may be added when one intra predictionmode is added. When two intra prediction modes are added, the intraprediction modes to be added vary according to whether the availableintra prediction mode is a directional intra prediction mode or not. Ifthe available intra prediction mode is one of non-directional intraprediction modes (that is, DC mode and planar mode), a vertical mode anda horizontal mode may be added or the other directional intra predictionmode and a vertical mode may be added. If the available intra predictionmode is a directional intra prediction mode, two intra prediction modesadjacent to the directional intra prediction mode may be added. But, ifthere exist the adjacent intra prediction mode in only one side of theavailable intra prediction mode (that is, the available intra predictionmode is mode 6 or 9), the one adjacent intra prediction mode (mode 25 or33) and one of DC mode and planar mode may be added.

When the intra prediction mode of the current prediction unit belongs tothe second intra prediction mode group, the index corresponds to areordered number of the intra prediction mode of the current coding unitin the second intra prediction mode group.

The number of the intra prediction mode groups may be 3. When the numberof the intra prediction mode groups is 3, if the intra prediction modeof the current prediction unit does not belong to the first intraprediction mode group, it is determined whether the intra predictionmode of the current prediction unit belongs to the second intraprediction mode group. If the intra prediction mode of the currentprediction unit belongs to the second intra prediction mode group,information indicating the second intra prediction mode group and anindex corresponding to the intra prediction mode of the current codingunit in the second intra prediction mode group are encoded. If the intraprediction mode of the current prediction unit does not belong to thesecond intra prediction mode group, information indicating the thirdintra prediction mode group and an index corresponding to the intraprediction mode of the current coding unit in the third intra predictionmode group are encoded. The second intra prediction mode group isgenerated based on the left and above intra prediction modes of thecurrent prediction unit.

Alternatively, the intra prediction mode of the current prediction modemay be encoded as follows. First, it is determined whether the intraprediction mode of the current prediction unit is equal to one of theintra prediction mode of previous intra prediction units. If the intraprediction mode of the current prediction unit is equal to one of theintra prediction mode of previous intra prediction units, a pred_flag isset to 1 and the intra prediction mode is encoded using the availableleft or above intra prediction mode. Otherwise, pred_flag is set to 0and an index indicating the ordered number of the intra prediction modeof the current coding unit among intra prediction modes other than theleft and above intra prediction modes is coded.

Meanwhile, intra prediction modes of chrominance component may includesa mode using corresponding intra prediction mode of luminance component.A flag indicating whether the mode using corresponding intra predictionmode of luminance component is used or not may be included in a sequenceparameter set (SPS), a picture parameter set (PPS) or a slice header.The number of intra prediction modes of chrominance component may varyaccording to a size of the prediction block. The intra prediction modesof chrominance component may be encoded using intra prediction modes ofadjacent chrominance coding units.

The prediction block transmitting unit 156 transmits the predictionblock generated using the intra prediction mode to the subtracter 190.

FIG. 5 is a block diagram of a moving picture decoding apparatusaccording to the present invention.

The moving picture decoding apparatus according to the present inventionincludes an entropy decoding unit 210, an inverse scanning unit 220, aninverse quantization unit 230, an inverse transform unit 240, an intraprediction unit 250, an inter prediction unit 260, a post-processingunit 270, a picture storing unit 280, an adder 290 and a switch 295.

The entropy decoding unit 210 extracts intra prediction information,inter prediction information and quantized coefficients information froma received bit stream. The entropy decoding unit 210 transmits the interprediction information to the inter prediction unit 260, the intraprediction information to the intra prediction unit 250 and thequantized coefficients information to the inverse scanning unit 220.

The inverse scanning unit 220 converts the quantized coefficientsinformation into two dimensional quantized transform block. One of aplurality of inverse scan patterns is selected for the conversion. Theinverse scan pattern is selected based on the intra prediction mode. Ifa size of a transform unit to be decoded is larger than thepredetermined reference size, the quantized transform coefficients ofeach subset are inversely scanned according to the selected inverse scanpattern to generate a plurality of subsets and a quantized transformblock having a size of the transform unit is generated using theplurality of subsets. If the size of a transform unit to be decoded isequal to the predetermined reference size, the quantized transformcoefficients of the quantized transform block are inversely scannedaccording to the selected inverse scan pattern to generate the quantizedtransform block having a size of the transform unit. The plurality ofsubsets consist of one main subset and one or more residual subsets. Themain subset is located at an upper left side and includes a DCcoefficient, and the one or more residual subsets cover region otherthan the main subset. A scan pattern to be applied to the subsets may bea zigzag scan. The subsets may be inversely scanned beginning with themain subset to the residual subsets in a forward direction, or can bescanned in the reverse direction. A scan pattern for scanning thesubsets may be set the same as a scan pattern for scanning the quantizedtransform coefficients. The inverse scanning unit 220 performs inversescanning procedure using information indicating a position of the lastnon-zero quantized coefficient of the transform unit.

The inverse quantization unit 230 determines a quantization step sizepredictor of a current coding unit. The operation of determining thequantization step size predictor is same as the operation of thequantization unit 130 of FIG. 1. The inverse quantization unit adds thedetermined quantization step size predictor and a received residualquantization step size to generate a quantization step size of thecurrent coding unit. The inverse quantization unit 230 restores inversequantized coefficients using a quantization matrix determined by thequantization step size. The quantization matrix varies according to thesize of the current block or the quantization matrix varies for a blockaccording to at least one of the prediction mode and the intraprediction mode.

The inverse transform unit 240 inversely transforms the inversequantized block to restore a residual block. The inverse transformmatrix to be applied to the inverse quantized block is adaptivelydetermined according to the prediction mode and the intra predictionmode. The determination procedure of the inverse transform matrix is thesame as the procedure in the transform unit 120 of FIG. 1.

The adder 290 adds the restored residual block and a prediction blockgenerated by the intra prediction unit 250 or the inter prediction unit260 to generate a reconstructed block.

The intra prediction unit 250 restores the intra prediction mode of thecurrent block based on the received intra prediction information, andgenerates a prediction block according to the restored intra predictionmode.

The inter prediction unit 260 restores reference picture indexes andmotion vectors based on the received inter prediction information, andgenerates a prediction block using the reference picture indexes and themotion vectors. When the motion vector does not indicate a pixelposition, the prediction block is generated using an interpolationfilter.

The post-processing unit 270 operates the same as the post-processingunit 160 of FIG. 1.

FIG. 6 is a block diagram of the intra prediction unit 250 of a movingpicture decoding apparatus 200 according to the present invention.

The intra prediction unit 250 according to the present inventionincludes a intra prediction mode decoding unit 251, a reference pixelgenerating unit 252, a reference pixel filtering unit 253, a predictionblock generating unit 254 and a prediction block transmitting unit 255.

The intra prediction mode decoding unit 251 receives the intraprediction information from the entropy decoding unit 210 and restoresthe intra prediction mode of the current prediction unit using the intraprediction information. The intra prediction information includesinformation indicating the intra prediction mode group and the intraprediction mode index.

The intra prediction mode decoding unit 251 derives intra predictionmodes of the prediction units adjacent to the current prediction unit.The intra prediction mode may be the intra prediction mode of a leftintra prediction unit and an above intra prediction unit. When thereexist a plurality of above prediction units of the current predictionunit, the plurality of above prediction units are scanned in apredetermined direction (e.g., from right to left) to determine theintra prediction mode of a first valid prediction unit as an above intraprediction mode. Also, when there exist a plurality of left predictionunits of the current prediction unit, the plurality of left predictionunits are scanned in a predetermined direction (e.g., from bottom totop) to determine the intra prediction mode of a first valid predictionunit as a left intra prediction mode. Alternatively, among a pluralityof valid prediction units, the intra prediction mode of a validprediction unit having the lowest intra prediction mode number may beset as an above intra prediction mode.

The above intra prediction mode or the left intra prediction mode isconverted into one of the permissible modes when the above intraprediction mode number or the left intra prediction mode number is equalto or greater than the number of intra prediction modes permissible forthe current prediction unit.

A first intra prediction mode group is constructed using the derived orconverted intra prediction mode. The derived or converted intraprediction modes and one or more intra prediction mode candidatesdetermined in a predetermined order by the derived or converted intraprediction modes are used to construct the first intra prediction modegroup. When the derived or converted intra prediction mode isdirectional mode, the one or more intra prediction mode candidates maybe directional intra prediction mode closest to the derived or convertedintra prediction mode.

The intra prediction mode decoding unit 251 determines whether theinformation indicating the intra prediction mode group indicates thefirst intra prediction mode group or not.

If the information indicating the intra prediction mode group indicatesthe first intra prediction mode group, the intra prediction mode of thefirst intra prediction mode group indicated by the received intraprediction mode index is set as the intra prediction mode of the currentprediction unit.

If the information indicating the intra prediction mode group indicatesthe second intra prediction mode group, the intra prediction mode of thesecond intra prediction mode group indicated by the received intraprediction mode index is set as the intra prediction mode of the currentprediction unit. The second intra prediction mode group includes allintra prediction modes other than the intra prediction modes belongingto the first intra prediction mode group. The intra prediction modes ofthe second intra prediction mode may be reordered with reference to theintra prediction mode index. The current intra prediction mode of thesecond intra prediction mode may be reordered based on the intraprediction mode index and the left and above intra prediction modes.

When none of the above intra prediction mode and the left intraprediction mode is available, one or more intra prediction modes areadded to the first intra prediction mode group. For example, DC mode orplanar mode may be added when one intra prediction mode is added. DCmode and planar or vertical mode may be added when two intra predictionmodes are added. DC mode, planar mode, and one of the vertical mode andhorizontal mode may be added when three intra prediction modes areadded.

When one of the above intra prediction mode and the left intraprediction mode is available or when the above intra prediction mode andthe left intra prediction mode are same, one or two intra predictionmodes may be added to the first intra prediction mode group. Forexample, DC mode or planar mode may be added when one intra predictionmode is added. When two intra prediction modes are added, the intraprediction modes to be added vary according to whether the availableintra prediction mode is a directional intra prediction mode or not. Ifthe available intra prediction mode is one of non-directional intraprediction modes (that is, DC mode or planar mode), a vertical mode anda horizontal mode may be added or the other non-directional intraprediction mode (that is, planar mode or DC mode) and a vertical modemay be added. If the available intra prediction mode is a directionalintra prediction mode, two intra prediction modes adjacent to thedirectional intra prediction mode may be added. But, if there exist theadjacent intra prediction mode in only one side of the available intraprediction mode (that is, the available intra prediction mode is mode 6or 9), the adjacent intra prediction mode (mode 25 or 33) and one of DCmode and planar mode may be added.

Alternatively, the intra prediction mode of the current prediction modemay be decoded as follows. First, a pred_flag indicating whether theintra prediction mode of the current prediction unit is equal to one ofthe intra prediction modes of previous intra prediction units is parsed.If the pred_flag is 1, the intra prediction mode of the currentprediction unit is determined using available left and above intraprediction modes. If the pred_flag is 0, the intra prediction mode ofthe current prediction unit is determined using rem_pred_mode. Therem_pred_mode indicates the order of the current intra prediction modeamong all available intra predictions mode other than the left and aboveintra prediction modes.

The reference pixel generating unit 252 generates reference pixels usingthe same method as described in the reference pixel generating unit 151of the coding apparatus 100. But, the reference pixel generating unit252 may generate reference pixels only when the reference pixels usedfor generating a prediction block and determined by the intra predictionmode are not available.

The reference pixel filtering unit 253 adaptively filters the referencepixels based on the intra prediction mode and a size of the predictionblock. The filtering condition and method are same as those of thereference pixel filtering unit 152 of the coding apparatus 100.

The prediction block generating unit 254 generates a prediction blockusing the same method as used in the prediction block generating unit154 of the coding apparatus 100.

The prediction block transmitting unit 255 transmits the predictionblock received from the prediction block generator 254 to the adder 290.

FIG. 7 is a flow chart illustrating a decoding procedure in intraprediction mode according to the present invention.

First, intra prediction information and residual signals arede-multiplexed from a received bit stream (S100). The step S100 isperformed on a coding unit. The intra prediction information isextracted from a prediction unit syntax in the coding unit syntax. Theresidual signals are extracted from a transform unit syntax in thecoding unit syntax.

The intra prediction mode of a current prediction unit is restored usingthe intra prediction information (S110). The intra predictioninformation includes the intra prediction mode group indicator(perd_mode) and the intra prediction mode index. If the intra predictioninformation does not include the intra prediction mode index, the intraprediction information is set to 0. The intra prediction mode groupindicator indicates the intra prediction mode group which the intraprediction mode of the current prediction unit belongs to. If the numberof the intra prediction mode groups is 2, the intra prediction modegroup indicator is a flag of one bit. The number of the intra predictionmode groups may be 2 or 3.

FIG. 8 is a flow chart illustrating a procedure for restoring intraprediction mode according to the present invention. The number of intraprediction modes belonging to the first intra prediction mode groupvaries. The number of the intra prediction mode groups is 2.

First, a first intra prediction mode group is constructed using intraprediction modes of the prediction units adjacent to the currentprediction unit (S111).

For example, the first intra prediction mode group is comprised of validintra prediction modes of the above and left intra prediction units ofthe current prediction unit. If both of the intra prediction modes ofthe above and left intra prediction units are unavailable, DC mode orplanar mode may be added to the first intra prediction mode group. Thefirst intra prediction mode group may include one additional intraprediction mode which is a first valid intra prediction mode encounteredwhen retrieving a right above intra prediction mode, a left below intraprediction mode, a left above intra prediction mode of the currentprediction unit.

When there exist a plurality of above prediction units of the currentprediction unit, the plurality of above prediction units are scanned ina predetermined direction (e.g., from right to left) to determine theintra prediction mode of a first valid prediction unit as an above intraprediction mode. Also, when there exist a plurality of left predictionunits of the current prediction unit, the plurality of left predictionunits are scanned in a predetermined direction (e.g., from bottom totop) to determine the intra prediction mode of a first valid predictionunit as a left intra prediction mode.

The derived intra prediction mode may be converted into one of thepermissible modes when the derived intra prediction mode number is equalto or greater than the number of intra prediction modes permissible forthe current prediction unit.

It is determined whether the intra prediction mode of the currentprediction unit belongs to the first intra prediction mode group or notbased on the intra prediction mode group indicator (S112).

If the intra prediction mode of the current prediction unit belongs tothe first intra prediction mode group, it is determined whether theintra prediction mode index exists or not (S113).

If the intra prediction mode index exists, the intra prediction mode ofthe first intra prediction mode group corresponding to the intraprediction mode index is determined as the intra prediction mode of thecurrent prediction unit (S114).

If the intra prediction mode index does not exist, the intra predictionmode index is set to 0 and the intra prediction mode of the first intraprediction mode group corresponding to the intra prediction mode index 0is determined as the intra prediction mode of the current predictionunit (S115).

If the intra prediction mode of the current prediction unit does notbelong to the first intra prediction mode group, the intra predictionmode of the second intra prediction mode group corresponding to theintra prediction mode index is determined as the intra prediction modeof the current prediction unit (S116). The second intra prediction modegroup includes all intra prediction modes other than the intraprediction modes belonging to the first intra prediction mode group. Theintra prediction mode index is assigned in the order of the mode numberof the intra prediction mode of the second intra prediction mode group.

FIG. 9 is a flow chart illustrating another procedure for restoringintra prediction mode according to the present invention. The number ofintra prediction modes belonging to a first intra prediction mode groupis fixed.

First, a first intra prediction mode group is constructed using intraprediction modes of the prediction units adjacent to the currentprediction unit (S211).

When the first intra prediction mode group includes two intra predictionmodes, the first intra prediction mode group is constructed as follows.

It is determined whether the intra prediction modes of the above andleft intra prediction units of the current prediction unit are availableor not. If the available intra prediction mode is not one of theallowable intra prediction modes of the current prediction unit, theavailable intra prediction mode is converted to one of the allowableintra prediction modes. When both of the intra prediction modes of theabove and left intra prediction units are available and are not same,the first intra prediction mode group is comprised of the intraprediction modes of the above and the left intra prediction units. Whenone of the intra prediction modes of the above and left intra predictionunits is only available or when the intra prediction modes of the aboveand left intra prediction units are same, the first intra predictionmode group is comprised of the available intra prediction mode and oneadditional intra prediction mode. If the available intra prediction modeis not DC mode, the additional intra prediction mode may be DC mode. Ifthe available intra prediction mode is DC mode, the additional intraprediction mode may be planar mode or vertical mode.

When the first intra prediction mode group includes three intraprediction modes, the first intra prediction mode group is constructedas follows.

It is determined whether the intra prediction modes of the above andleft intra prediction units of the current prediction unit are availableor not. If the available intra prediction mode is not one of theallowable intra prediction modes of the current prediction unit, theavailable intra prediction mode may be converted to one of the allowableintra prediction modes.

When both of the intra prediction modes of the above and left intraprediction units are available and are not same each other, the firstintra prediction mode group is comprised of the two available intraprediction modes and one additional intra prediction mode. Theadditional intra prediction mode is different from the two availableintra prediction modes and is one of a vertical mode, a horizontal modeand a DC mode. The additional intra prediction mode is the first intraprediction mode able to be added in the order of the DC mode, thevertical mode and the horizontal mode.

When only one of the intra prediction modes of the above and left intraprediction units is available or when the intra prediction modes of theabove and left intra prediction units are same, the first intraprediction mode group is comprised of the one available intra predictionmode and two additional intra prediction modes. The two additional intraprediction modes are adaptively determined according to the availableintra prediction modes and a size of the prediction unit. If the size ofthe intra prediction unit is equal to or smaller than a predeterminedsize and the available intra prediction mode is a directional mode, twointra prediction modes having direction closest to the direction of theavailable intra prediction mode are selected as the two additional intraprediction modes. But, if there exists only one intra prediction modehaving direction closest to the direction of the available intraprediction mode (that is, the available intra prediction mode is mode 6or 9), mode 6 or 9 is selected as the other additional intra predictionmode. If the available intra prediction mode is non-directional intraprediction mode, the two additional intra prediction modes are avertical mode and a horizontal mode, or the other non-directional intraprediction mode and a vertical mode.

When all of the intra prediction modes of the above and left intraprediction units are unavailable, the first intra prediction mode groupis comprised of three additional intra prediction modes. The threeadditional intra prediction modes may be a DC mode, a vertical mode anda horizontal mode, or a DC mode, a planar mode and a vertical mode.

When there exist a plurality of above prediction units of the currentprediction unit, the plurality of above prediction units are scanned ina predetermined direction (e.g., from right to left) to determine theintra prediction mode of a first valid prediction unit as an above intraprediction mode. Also, when there exist a plurality of left predictionunits of the current prediction unit, the plurality of left predictionunits are scanned in a predetermined direction (e.g., from bottom totop) to determine the intra prediction mode of a first valid predictionunit as a left intra prediction mode.

Next, it is determined whether the intra prediction mode of the currentprediction unit belongs to the first intra prediction mode group or notbased on the intra prediction mode group indicator (S212).

If the intra prediction mode of the current prediction unit belongs tothe first intra prediction mode group, the intra prediction mode of thefirst intra prediction mode group corresponding to the intra predictionmode index is determined as the intra prediction mode of the currentprediction unit (S213).

If the intra prediction mode of the current prediction unit does notbelong to the first intra prediction mode group, the intra predictionmode of the second intra prediction mode group corresponding to theintra prediction mode index is determined as the intra prediction modeof the current prediction unit (S214). The second intra prediction modegroup includes all intra prediction modes other than the intraprediction modes belonging to the first intra prediction mode group. Theintra prediction mode index is assigned in the order of the mode numberof the intra prediction mode of the second intra prediction mode group.

Next, reference pixels are adaptively generated based on the restoredintra prediction mode of the current prediction unit (S120).

When there are available reference pixels in only one side of theposition of the unavailable reference pixel, the reference pixels aregenerated by copying the value of an available pixel closest to theunavailable pixel. Alternatively, the reference pixels are generatedusing two available pixels closest to the unavailable pixel. When theunavailable reference pixel exists between the available pixels, thereference pixel is generated using two available reference pixelsclosest to the unavailable pixel in both sides. The value of thegenerated reference pixel may be average of the two available referencepixels. Linear interpolation method may be used to generate thereference pixels when a difference between the two available referencepixels is large.

Next, the reference pixels are adaptively filtered based on the restoredintra prediction mode (S130). When the restored intra prediction mode isa vertical mode, a horizontal mode or a DC mode, the reference pixelsare not filtered. In directional intra prediction mode other than thevertical mode and the horizontal mode, the reference pixels areadaptively filtered. The rightmost pixel of the above reference pixelslocated at (x=2N−1, y=−1) and the lowest pixel of the left referencepixels located at (x=−1, y=2N−1) are not filtered. The reference pixelis filtered using two adjacent reference pixels.

Low-pass filter is applied to smooth the difference between adjacentreference pixels. The low-pass filter may be a 3-tap filter [1, 2, 1] ora 5-tap filter [1, 2, 4, 2, 1].

A filter is adaptively applied to the reference pixels according to thesize of the prediction block in the directional intra prediction modesexisting between a horizontal or vertical mode and the intra predictionmode having a direction of 45° with reference to the horizontal orvertical direction. The filter may be applied in a predetermined numberof intra prediction modes closest to the mode having a direction of 45°with reference to the horizontal or vertical direction. Thepredetermined number may be increase as the size of the prediction blockincreases. For example, the filter is applied in a first number of intraprediction modes closet to mode 3, 6 or 9 for a size of 8×8, in a secondnumber of intra prediction modes closet to mode 3, 6 or 9 for a size of16×16 and in in a third number of intra prediction modes closet to mode3, 6 or 9 for a size of 32×32. The first number is equal to or smallerthan the second number, and the second number is equal to or smallerthan the third number.

Next, a prediction block is generated using the reference pixelsaccording to the restored intra prediction mode (S140). The method ofgenerating a prediction block is the same as that of the intraprediction block generating unit 254 of FIG.6

The residual signals are entropy-decoded (S150).

The residual signals is inversely scanned (S160). That is, the residualsignals are converted to two dimensional quantized transform block. Oneinverse scan pattern is selected among a plurality of inverse scanpatterns for this conversion. The inverse scan pattern is determinedaccording to the intra prediction mode of the current prediction unit.If the size of the transform unit is larger than a predetermined size,the residual signals are inversely scanned in the unit of subset, aquantized transform block is generated using a plurality of subsets. Ifthe size of the transform unit is equal to the predetermined size, theresidual signals are inversely scanned in the unit of transform unit.

The two dimensional quantized transform block is inversely quantized(S170). The quantization step size predictor of the current coding unitis determined for inverse quantization. The quantization step sizepredictor is determined using the same method as that of the inversequantization unit 230 of FIG. 5. The determined quantization step sizepredictor and a received residual quantization step size are added togenerate a quantization step size applied to transform block. Thequantization matrix determined by the quantization step size is used torestore transform coefficients.

The inverse-quantized block is inversely transformed (S180). A inversetransform matrix type may be adaptively determined according to therestored intra prediction mode. The residual signals of the transformblock may be inversely transformed by horizontal and verticalone-dimensional (1D) transform matrices. In intra prediction, there is ahigh possibility that the residual signals will have verticaldirectivity when the intra prediction mode of the current predictionunit is horizontal. Thus, the DCT-based integer matrix is applied to thevertical direction, and the DST or KLT-based integer matrix is appliedto the horizontal direction. When the intra prediction mode is vertical,an inverse DST or KLT-based integer matrix is applied to the verticaldirection, and an inverse DCT-based integer matrix is applied to thehorizontal direction. When the intra prediction mode is a DC mode, aninverse DCT-based integer matrix is applied in the both directions.

The prediction block and the inverse-transformed block are added togenerate a reconstructed image (S190). The residuals signals and theprediction signals may be added in the unit of coding unit.

While the invention has been shown and described with reference tocertain exemplary embodiments thereof, it will be understood by thoseskilled in the art that various changes in form and details may be madetherein without departing from the spirit and scope of the invention asdefined by the appended claims.

1. A method for encoding an intra prediction mode, comprising:determining an intra prediction mode of a current prediction unit;generating a first intra prediction mode group using available intraprediction modes of a left prediction unit and an above prediction unitneighboring the current prediction unit, wherein the number of intraprediction modes belonging to the first intra prediction mode group isfixed to three; generating a second intra prediction mode group usingintra prediction modes other than the intra prediction modes belongingto the first intra prediction mode group; encoding informationindicating the first intra prediction mode group and an intra predictionmode index corresponding to the intra prediction mode of the currentprediction unit when the intra prediction mode of the current predictionunit is included in the first intra prediction mode group; and encodinginformation indicating a second intra prediction mode group and an intraprediction mode index corresponding to the intra prediction mode of thecurrent prediction unit when the intra prediction mode of the currentprediction unit does not belong to the first intra prediction modegroup, wherein, when only one intra prediction mode out of the intraprediction modes of the left prediction unit and the above predictionunit is available, the first intra prediction mode group includes theone available intra prediction mode of the respective prediction unitsand two additional intra prediction modes that are determined such thatwhen the one available intra prediction mode is a non-directional intraprediction mode, the two additional intra prediction modes includeanother non-directional intra prediction mode and a vertical mode. 2.The method of claim 1, wherein, when the one available intra predictionmode is a DC mode, the two additional intra prediction modes include aplanar mode and the vertical mode.
 3. The method of claim 1, wherein,when the one available intra prediction mode is a planar mode, the twoadditional intra prediction modes include a DC mode and the verticalmode.
 4. The method of claim 1, wherein the second intra prediction modegroup includes intra prediction modes other than the intra predictionmodes belonging to the first intra prediction mode group.